package com.cci.kangdao.ecjv.controller;

import com.alibaba.fastjson.JSONObject;
import com.cci.kangdao.dto.BaseResponse;
import com.cci.kangdao.ecjv.dto.EcjvTypicalCaseTDto;
import com.cci.kangdao.ecjv.model.ECJVEngineTypeT;
import com.cci.kangdao.ecjv.model.ECJVUserSearchTypicalCaseRecordT;
import com.cci.kangdao.ecjv.service.ECJVTypicalCaseTService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: joe
 * @company: CTY
 * @since: 2022/10/24 13:41
 * @version: V1.0
 **/
@RestController
public class ECJVTypicalCaseTController {
    /**
     * 变速箱典型案例  app 端调用接口   获取集合的接口
     */
    @Autowired
    private ECJVTypicalCaseTService ecjvTypicalCaseTService;

    @RequestMapping(value = "ecjvTypicalCaseT/getList.aspx")
    public BaseResponse getList(@RequestBody EcjvTypicalCaseTDto ecjvTypicalCaseTDto) {
        PageInfo pageInfo = ecjvTypicalCaseTService.getList(ecjvTypicalCaseTDto);
        return BaseResponse.success(pageInfo);
    }

    /**
     * 变速箱典型案例  app 端调用接口  获取历史记录接口
     */
    @RequestMapping(value = "ecjvTypicalCaseRecordT/getTypicalCaseRecordTList.aspx", method = RequestMethod.GET)
    public BaseResponse getListTypicalCaseRecord() {
        List<ECJVUserSearchTypicalCaseRecordT> list = ecjvTypicalCaseTService.TypicalCaseRecord();
        return BaseResponse.success(list);
    }

    /**
     * 变速箱典型案例  app 端调用接口  获取机型接口
     */
    @RequestMapping(value = "ecjvEngineType/getEngineTypeList.aspx", method = RequestMethod.GET)
    public BaseResponse engineType() {
        List<ECJVEngineTypeT> list = ecjvTypicalCaseTService.getEngineTypeList();
        return BaseResponse.success(list);
    }
}
